#ifndef GPIO_H
#define GPIO_H

#include<sys/types.h>
#include<stdio.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<QTimer>
#include <QObject>

#define GPIO_EXP0_INT_DIR "/sys/class/gpio/gpio480/direction"
#define GPIO_EXP0_INT_VAL "/sys/class/gpio/gpio480/value"

class Gpio : public QObject
{
    Q_OBJECT
public:
    Gpio();
    ~Gpio();

private slots:
    void timerOutSlot();
    void dvpDoneSlot();
    void ximeaDoneSlot();
    void timerStartSlot();
    void cameraReadySlot();

signals:
    void shotSignal();

private:
    int readgpio();
    int changeSignal();
    int ready = 0;
    int last_level = 1;
    int this_level = 1;
    int dvpFlag = 0;
    int ximeaFlag = 0;

    QTimer *qtimer;
};

#endif // GPIO_H
